package 贪心.easy;

/**
 * @author Lw中
 * @date 2020/8/12 15:28
 */
public class YiWuYiBa {

    public static int numWaterBottles(int numBottles, int numExchange) {
        int bottles = numBottles, res = numBottles;
        while (bottles >= numExchange) {
            bottles = bottles -  numExchange;
            res = res + 1;
            bottles = bottles + 1;
        }
        return res;
    }

    public static void main(String[] args) {
        int i = numWaterBottles(9, 3);
        System.out.println(i);
    }

}
